<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>访问ajax</title>
</head>
<body>
    <button onclick="myclick()">提交</button>
</body>
</html>
<script src="./ajax.js"></script>
<script>
    console.log(window.request.post);
    function myclick(){
        console.log("点击事件");
        const fn = (res)=>{
            console.log(res,"| res");
        }
        window.request.post('http://localhost:7000',{uname:'yl',upwd:123},fn,{"Content-type":"application/json"})
    }
</script>